USE [AnotherSuccessfulProcedure]

IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[CaptureListSelectCountByPlayerIdLogId]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
	DROP PROCEDURE dbo.CaptureListSelectCountByPlayerIdLogId
END


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Neil Wilson
-- Create date: 09/03/08
-- Description:	Captures Table Select Count By PlayerId and LogId
-- =============================================
CREATE PROCEDURE CaptureListSelectCountByPlayerIdLogId

            @LogId int,
			@PlayerId varchar(30),
			@CaptureListCount int = 0 OUTPUT
	
AS

BEGIN

select @CaptureListCount = COUNT(CaptureListId) FROM CaptureList 
		WHERE CaptureId IN (SELECT CaptureId FROM Captures WHERE LogId = @LogId)
		AND PlayerId = @PlayerId


END
GO
